import request from '../request'
import { config } from '../../config'

const login = {

	getToken: (isReg, loginName,loginType)=>{
		const data = {
			register: isReg,
			loginName: loginName,
			loginType: loginType,
			appId: config().appid
    }
    console.log(data)
		return request({
      header: { isToken: false },
			url: '/login/token',
			method: 'post',

			data: data
		})
	},
	refreshToken: ()=>{
		return request({
			url: '/login/refreshToken',
			method: 'get'
		})
  },
  userInfo: ()=>{
    return request({
      url: '/login/userinfo',
      method: 'get'
    })
  },
	logout: ()=>{
		return request({
			url: '/logout',
			method: 'post'
		})
	}

}

export default login